import org.jasypt.util.password.BasicPasswordEncryptor;

/*
 * Class User.
 * Stores user profile.
 */

public abstract class User {

	private String name;
	private String surname;
	private String userName;
	private String password;
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getSurname() {
		return surname;
	}
	
	public void setSurname(String surname) {
		this.surname = surname;
	}
		
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public boolean checkPassword(String password) {
		BasicPasswordEncryptor encryptor = new BasicPasswordEncryptor();
		return encryptor.checkPassword(password, this.password);
	}
	
	public void setPassword(String password) {
		BasicPasswordEncryptor encryptor = new BasicPasswordEncryptor();
		password = encryptor.encryptPassword(password);
	}
	
}
